/**
 * Package for Environments area's containers classes.
 */
jsx3.lang.Package.definePackage("tibco.admin.environments.containers", function() {
});

/**
 * Interface to be implemented by all plugin components wishing to add additional UI support for a
 * particular container type.
 */
jsx3.lang.Class.defineInterface(
        "tibco.admin.environments.containers.ContainersInterface",
        tibco.admin.plugin.PluginInterface,
        function(plugin) {

            /**
            * {Object} the object to perform callbacks on.  Set by the parent plugin container.
            * @private
            */
            plugin.prototype.callbackTarget = null;

            /**
            * {Function} the function to call on the <code>callbackTarget</code> when a plugin component
            * begins extended configuration on a container.  Set by the parent plugin container.
            * @private
            */
            plugin.prototype.beginConfigureCallback = null;

            /**
             * {Function} the function to call on the <code>callbackTarget</code> when a plugin component
             * ends extended configuration on a container.  Set by the parent plugin container.
             * @private
             */
            plugin.prototype.endConfigureCallback = null;

            /**
            * Abstract function to be implemented by the plugin component. Gets the type of container supported by this
            * plugin component.
            *
            * @return {String} the container type supported by this plugin component.
            */
            plugin.prototype.getType = jsx3.lang.Method.newAbstract();

            /**
            * Abstract function to be implemented by the plugin component.  Called by the parent plugin container to
            * determine if a container that matches the type returned from the <code>getType</code> function requires
            * the ability to have extended configuration be accessible via a link inthe UI.
            *
            * @return {boolean} true if this plugin component handles additional configuration support for the container
            */
            plugin.prototype.hasExtendedConfiguration = jsx3.lang.Method.newAbstract();

            /**
            * Abstract method to be implemented by plugin components.  Called by the parent to check if the pluginis
            * currently in the processof performing extended configuration of the selected container or not.
            *
            * @return {boolean} <code>true</code> if the pluginis currently in the processof configuring the container
            */
            plugin.prototype.isInConfigureMode = jsx3.lang.Method.newAbstract();

            /**
            * Abstract method to be implemented by plugin components.  Called by theparent plugin container to set the
            * id of the currently selected environment.
            *
            * @param envId {String} the id of the currently selected environment
            */
            plugin.prototype.setEnvId = jsx3.lang.Method.newAbstract("envId");

            /**
             * Abstract method to be implemented by plugin components.  Called by theparent plugin container to set the
             * id of the SINGLE currently selected node.
             *
             * @param nodeId {String} the id of the SINGLE currently selected node, or null if no node is selected or
             *                        multiple nodes are selected
             */
            plugin.prototype.setNodeId = jsx3.lang.Method.newAbstract("nodeId");

            /**
            * Abstract method to be implmeneted by the plugin component.  Called by the parent plugin container to set the
            * details about the currently selected node.
            * <br /><br />
            * Includes information about the version number of the container.  The full version can be reconstructed as follows:
            * <br /><br />
            * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[major].[minor].[maintenance].[fragment]
            * <br /><br />
            * where [major], [minor], [maintenance],and [fragment] should be replaced with the appropriate parameter from
            * the following input parameters:
            * <br />
            * @param containerName {String} the name of the currently selected container
            * @param major {String} the major version of the currently selected container
            * @param minor {String} the minor version of the currently selected container
            * @param maintenance {String} the maintenance version of the currently selected container
            * @param fragment {String} the fragment version of the currently selected container
            */
            plugin.prototype.setContainer = jsx3.lang.Method.newAbstract("containerName", "major", "minor", "maintenance", "fragment");

            /**
            * Preimplemented function.  Plugin should call this function when entering the extended configuration of a
            * container, to notify the parent plugin container if this state change.
            */
            plugin.prototype.beginConfigureMode = function() {
                try {
                    var me = this;
                    this.beginConfigureCallback.call(this.callbackTarget, me);
                }
                catch(ex) {
                    tibco.admin.Main.logException(ex);
                }
            }

            /**
             * Preimplemented function.  Plugin should call this function when completing the extended configuration of a
             * container, to notify the parent plugin container if this state change.
             */
            plugin.prototype.endConfigureMode = function() {
                try {
                    var me = this;
                    this.endConfigureCallback.call(this.callbackTarget, me);
                }
                catch(ex) {
                    tibco.admin.Main.logException(ex);
                }
            }
        }
        );